﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Text;

namespace Mr.LinqToWeibo.SearchCriteria
{
	public static class SearchCriteriaHelper
	{
		public static ISearchCriteria GetCriteria (Expression rootExpression)
		{
			if (rootExpression == null) {
				return null;
			}
			
			SearchCriteriaCreator creator = new SearchCriteriaCreator (rootExpression);
			ISearchCriteria criteria = creator == null ? new SearchCriteriaImpl () : creator.Criteria;

			return criteria;
		}
	}
}
